The present application relates generally to an improved data processing apparatus and method and more specifically to mechanisms for path-sensitive analysis for reducing rollback overheads.
The C programming language has a construct for complex flow control. The “setjmp” function saves the state of a program. The program state is completely defined by the set of registers and the contents of the memory. The “longjmp” function restores the state of the program. Prior to the call to setjmp, the program must save all volatile registers, and after the longjmp call, the program must restore all these registers. When a program changes the value of a register, the register is said to be “clobbered.”
In the setjmp function itself, all non-volatile registers are saved to memory regardless of whether they are live at the time of the call. The same is true for the longjmp function, except that the longjmp function restores all non-volatile registers regardless of whether they have been altered since the call to setjmp.
The setjmp/longjmp functions are function calls within a program; therefore, one can predict when they will happen. On the other hand, a rollback happens when some event occurs outside of the program execution. The rollback restores the program state based on a checkpoint, which always saves all registers.